

@RestController
@RequestMapping("/rmsMaterialUsageConfig")
public class RmsMaterialUsageConfigController {

    @Resource
    private RmsMaterialUsageConfigService rmsMaterialUsageConfigService;


    /**
     * 获取 RmsMaterialUsageConfig 分页列表
     */
    @GetMapping("/pagination")
    public Ret getRmsMaterialUsageConfigPagination( PaginationVo paginationVo, RmsMaterialUsageConfigQuery rmsMaterialUsageConfigQuery ) throws Exception {
        IPage page = rmsMaterialUsageConfigService.getRmsMaterialUsageConfigPagination(paginationVo, rmsMaterialUsageConfigQuery );
        return Ret.toPage(page);
    }


    /**
     * 获取 RmsMaterialUsageConfig 所有数据
     */
    @GetMapping("/all")
    public Ret getRmsMaterialUsageConfigAllList( RmsMaterialUsageConfigQuery rmsMaterialUsageConfigQuery ) throws Exception {
        List<RmsMaterialUsageConfigEntity> list = rmsMaterialUsageConfigService.getRmsMaterialUsageConfigAllList( rmsMaterialUsageConfigQuery );
        return Ret.ok(list);
    }



    /**
     * 获取 RmsMaterialUsageConfig 详情
    */
   @GetMapping("/{id}")
   public Ret getRmsMaterialUsageConfigDetail(@PathVariable Long id) throws Exception {

       RmsMaterialUsageConfigEntity rmsMaterialUsageConfig = rmsMaterialUsageConfigService.getRmsMaterialUsageConfigDetail(id);
       return Ret.ok(rmsMaterialUsageConfig);
   }


    /**
     * 新增 RmsMaterialUsageConfig
     * */
    @PostMapping("")
    public Ret addRmsMaterialUsageConfig(@RequestBody RmsMaterialUsageConfigVo rmsMaterialUsageConfigVo) throws Exception {

        rmsMaterialUsageConfigService.addRmsMaterialUsageConfig(rmsMaterialUsageConfigVo);
        return Ret.ok();
    }


    /**
     * 更新 RmsMaterialUsageConfig
     * */
    @PutMapping("")
    public Ret updateRmsMaterialUsageConfig(@RequestBody RmsMaterialUsageConfigVo rmsMaterialUsageConfigVo) throws Exception {

        rmsMaterialUsageConfigService.updateRmsMaterialUsageConfig(rmsMaterialUsageConfigVo);
        return Ret.ok();
    }


    /**
     * 删除 RmsMaterialUsageConfig
     * */
    @PostMapping("/batchRemove")
    public Ret batchRemoveRmsMaterialUsageConfig( @RequestBody List<Long> ids ) throws Exception {

        rmsMaterialUsageConfigService.batchRemoveRmsMaterialUsageConfig(ids);
        return Ret.ok();
    }
}

  